package com.aphrodite.io.sip.dialog;

import com.aphrodite.io.sip.address.NameAddress;
import com.aphrodite.io.sip.message.Message;

/**
 * A SubscriberDialogListener listens for SubscriberDialog events. It collects
 * all SubscriberDialog callback functions.
 */
public interface SubscriberDialogListener {
	/** When an incoming NOTIFY is received. */
	public void onDlgNotify(SubscriberDialog dialog, NameAddress target, NameAddress notifier, NameAddress contact,
			String state, String content_type, String body, Message msg);

	/** When SUBSCRIBE transaction expires without a final response. */
	public void onDlgSubscribeTimeout(SubscriberDialog dialog);

	/** When a 300-699 response is received for an SUBSCRIBE transaction. */
	public void onDlgSubscriptionFailure(SubscriberDialog dialog, int code, String reason, Message msg);

	/**
	 * When a 2xx successfull final response is received for an SUBSCRIBE
	 * transaction.
	 */
	public void onDlgSubscriptionSuccess(SubscriberDialog dialog, int code, String reason, Message msg);

	/** When the dialog is terminated. */
	public void onDlgSubscriptionTerminated(SubscriberDialog dialog);

}
